Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update epub.py #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

RuthlessRuler
Copy link

Fixes the Issue of TOC having Book Title Heading. Issue: #179

Fixes the Issue of TOC having Book Title Heading.
@aerkalov
Copy link
Owner

aerkalov commented Mar 10, 2019

Well spotted but we can't really hard code English text inside. The option would be to do something like:

class EpubWriter(object):
    DEFAULT_OPTIONS = {
       'nav_title': None,
    ...
    }


epub.write_epub('test.epub', book, {"nav_title": 'Table of Contents'})

and then use book title if nav_title is None or else use whatever was defined during the writing. This way existing apps using current behaviour where book title is used will not be broken.

@RuthlessRuler
Copy link
Author

Okay. I was trying to follow you instructions, and added it Default Title.
The I used if/else statement to check whether nav_title == None and exceute the conditions.

In the end I'm getting the error while executing the script that It is NameError: name 'nav_title' is not defined.
What Should I do? I'm a beginner in python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants